﻿//5.Write a program that finds the maximal increasing sequence in an array. 

using System;

class MaximalSequenceOfEqualElements
{
    static void Main()
    {
        int[] exampleArray = new int[10];
        for (int i = 0; i < exampleArray.Length; i++)
        {
            exampleArray[i] = int.Parse(Console.ReadLine());
        }
        int counter = 1;
        int maxSequence = 1;
        int maxSequenceIndex = 0;
        for (int i = 1; i < exampleArray.Length; i++)
        {
            if (exampleArray[i] == exampleArray[i - 1] - 1)
            {
                counter++;
                if (counter > maxSequence)
                {
                    maxSequence = counter;
                    maxSequenceIndex = i;
                }
            }
            else
            {
                counter = 1;
            }
        }
        Console.WriteLine("Max sequence lenght is by {0} elements", maxSequence);
        for (int i = maxSequenceIndex - maxSequence + 1; i <= maxSequenceIndex; i++)
        {
            Console.Write("{0} ", i);
        }
    }
}
